const TOKEN_KEY = 'itcast-geek-token'

const setToken = (token) => {
    // 存token
    localStorage.setItem(TOKEN_KEY, token)
}

const removeToken = () => {
    // 移除token
    localStorage.removeItem(TOKEN_KEY)
}

const getToken = () => {
    // 获取token
    return localStorage.getItem(TOKEN_KEY)
}
const hasToken = () => !!getToken()

export { setToken, getToken, removeToken, hasToken }